import request from '@/utils/request'

// 查询队伍列表
export function listTeams(query) {
  return request({
    url: '/match/teams/list',
    method: 'get',
    params: query
  })
}

// 查询队伍详细
export function getTeams(teamId) {
  return request({
    url: '/match/teams/' + teamId,
    method: 'get'
  })
}

// 新增队伍
export function addTeams(data) {
  return request({
    url: '/match/teams',
    method: 'post',
    data: data
  })
}



// 活动页面新增队伍
export function createTeam(data) {
  return request({
    url: '/match/teams/addTeam',
    method: 'post',
    data: data
  })
}
// 修改队伍
export function updateTeams(data) {
  return request({
    url: '/match/teams',
    method: 'put',
    data: data
  })
}

// // 删除队伍
// export function delTeams(teamId) {
//   return request({
//     url: '/match/teams/' + teamId,
//     method: 'delete'
//   })
// }

// 删除队伍
export function delTeams(teamId) {
  return request({
    url: '/match/teams/myTeams/delete/' + teamId,
    method: 'delete'
  })
}

// 根据活动id查询队伍
export function getTeamsInfoByActId(actId) {
  return request({
    url: '/match/teams/byActId/' + actId,
    method: 'get',
    params: actId
  })
}


  // 查询当前用户加入的队伍
  export function showJoinedTeams() {
    return request({
      url: '/match/teams/joinedTeams/list',
      method: 'get'
    })
}

// 查询当前用户领导的队伍
export function showMyTeams() {
  return request({
    url: '/match/teams/myTeams/list',
    method: 'get'
  })
}


